module.exports.edit   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
dl 0
loc 5
rs 10
nop 3
1
const DB = require('../../libraries/db')
2
const ModelBase = require('../../model/base')
3
4
const table = 'mist_audit'
5
6
module.exports = {
7
    add: async function (data) {
8
        let res = await ModelBase.execInsert(table, data)
9
        return res;
10
    },
11
12
	first: async function (id) {
13
14
		let result = await DB.readMysql.first(
15
			'*'
16
		)
17
			.from(table)
18
			.where('audit_id', id)
19
			.where('status', 1)
20
21
		return result
22
23
	},
24
25
	edit: async function (data, where, notWhere = {}) {
26
		let result = await ModelBase.execUpdate(table, data, where, notWhere)
27
28
		return result
29
	}
30
31
}